<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>会员详情</title>
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
		<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
		<script src="__PUBLIC__/static/layui/layui.js"></script>
	</head>

	<body>
		<div class="right">
					<div class="rigtop">
						<span class="title">鼓励金报表
							<em style="font-size: 14px;">
								(鼓励金余额：{$sumbalance}
								{if count($score_change)>0},
								赠送鼓励金： <a href="javascript:;show_agent_score(2,{$id})" style="color: red;">
									{if abs($score_change['reduce_score'])>0}
										{$score_change['reduce_score']}
									{else}
										0
									{/if}
								</a>,
								收获鼓励金：<a href="javascript:;show_agent_score(1,{$id})" style="color: red;">
									{if $score_change['add_score']>0}
										+{$score_change['add_score']}
									{else}
										0
									{/if}
								</a> 
								{else}
								0
								{/if})
							</em>
						</span>
					</div>
					<div class="indrig_con">
						<form id="my_form" action="{:url('accounts/show_score')}" method="post">
							<div class="shxx_row clearfix" style="margin-top: 10px;">
								<div class="left">日期：</div>
								<div class="right clearfix">
					                <div class="layui-inline">
								      <div class="layui-input-inline">
								        <input type="text" class="layui-input" value="{$begin_time}" name="begin_time" id="begin_time" placeholder="yyyy年MM月dd日">
								      	<input type="hidden" name="type" value="{$type}" >
								      		<input type="hidden" name="id" value="{$id}" >
								      </div>
								    </div>
					                <i class="chax_line"></i>
					                <div class="layui-inline">
								      <div class="layui-input-inline">
								        <input type="text" class="layui-input" value="{$end_time}" name="end_time"  id="end_time" placeholder="yyyy年MM月dd日">
								      </div>
								    </div>
					            </div>
								<button type="submit" onclick="return check_time()" class="htcxbtn">查询</button>
							</div>
					    </form>
						<!--<div class="chax_jiegbt clearfix">
							<div class="chax_xzbtnbox">
								<a href="#" onclick="check()"><i class="iconfont icon-daochu"></i>导出</a>
							</div>
						</div>-->
						<div class="help_lisbox">
							<table class="zizh_table1">
								<thead>
									<tr>
										<th>购买明细</th>
										<th>金额</th>
										<th style="width: 200px;">时间</th>
									</tr>
								</thead>
								<tbody id="tbody">
									{volist name="$list" id="vo"}
									<tr>
										<td>{$vo.message}</td>
										<td>{$vo.balance}</td>
										<td>{$vo.add_time}</td>
									</tr>
									{/volist}
								</tbody>
							</table>
							<div class="fenye" style="display: block;">
								{$list->render()}
							</div>
						</div>
					</div>
				</div>
			
	</body>
</html>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
<script src="__PUBLIC__/static/layui/layui.all.js"></script>
<script>
	layui.use('laydate', function(){
		var laydate = layui.laydate;
		
		//日期控件
		laydate.render({
		    elem: '#begin_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
		  
		laydate.render({
		    elem: '#end_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
	})
	//时间区间
	function check_time(){
		var begin_time 	= $('#begin_time').val();
		var end_time 	= $('#end_time').val();	
		if(begin_time.length > 2 || end_time.length > 2){
			
			if(begin_time.length < 2 || end_time.length < 2){
				layer.msg("请输入查询时间区间");
				return false;
			}
			
		}
	}
	
	function show_agent_score(type,id){
			
			var show_url = "{:url('accounts/agent_score_detail')}"+"?type="+type+"&id="+id;
			
			top.layer.open({
				type: 2,
				title: '鼓励金记录',
				shadeClose: true,
				shade: 0.8,
				area: ['775px', '700px'],
				content: show_url
			});
		}
</script>